package struct.scene.ui
{
	import com.common.displayObjects.ComponentChildren;
	
	import data.MapVO;
	
	import flash.display.BitmapData;
	import flash.display.Graphics;
	
	import struct.scene.items.Grid;
	import struct.scene.items.MapItem;
	
	import utils.Util;

	public class Scene extends ComponentChildren
	{
		public var sceneMaplayer:SceneMapLayer;			 //地图层
		public var sceneGridlayer:SceneGridlayer;		//地格层
		public var scenePlayerlayer:ScenePlayerLayer;  // 角色层
		
		private var mapVO:MapVO;
		public function Scene(_w:Number, _h:Number, mapVO:MapVO)
		{
			super(_w, _h);
			this.mapVO = mapVO;
		}
		
		override protected function createChildren():void
		{
			super.createChildren();
			sceneMaplayer = new SceneMapLayer(width, height);
			sceneGridlayer = new SceneGridlayer(width, height);
			scenePlayerlayer = new ScenePlayerLayer(width, height);
			
			addChild(sceneMaplayer);
			addChild(sceneGridlayer);
			addChild(scenePlayerlayer);
		}
		
		public function initMapLayer(missionID:int):void
		{
			//初始化地图
			sceneMaplayer.initMapLayer(missionID);
		}
		
		public function initGridlayer(arrGridInfo:Array):void
		{
			//初始化地格
			sceneGridlayer.initGridlayer(arrGridInfo, mapVO);
		}
		
		public function initPlayerLayer(arrPlayerPosition:Array):void
		{
			//初始化player
			scenePlayerlayer.initPlayerLayer(arrPlayerPosition, mapVO);
		}
		
		override public function dispose():void
		{
			super.dispose();
		}
	}
}